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Z2VudCI6ICJva2h0dHAvNC42LjAiCiAgICB9LAogICAgdGltZW91dDogNTAwMCwKICAgIGNsYXNzX25hbWU6ICfnlLXop4bliacm55S15b2xJuWKqOa8qybnu7zoibom5rW35aSW57K+6YCJJywgLy8gL2FwaS5waHAvcHJvdmlkZS9ob21lX25hdgogICAgY2xhc3NfdXJsOiAnMiYxJjQmMyY0NicsCiAgICBsaW1pdDogMjAsCiAgICBwbGF5X3BhcnNlOiB0cnVlLAogICAgbGF6eTogYGpzOgogICAgICAgIHRyeSB7CiAgICAgICAgICAgIGZ1bmN0aW9uIGdldHZpZGVvKHVybCkgewogICAgICAgICAgICAgICAgbGV0IGpEYXRhID0gSlNPTi5wYXJzZShyZXF1ZXN0KHVybCwgewogICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGdldEhlYWRlcnModXJsKQogICAgICAgICAgICAgICAgfSkpOwogICAgICAgICAgICAgICAgaWYgKGpEYXRhLmNvZGUgPT0gMSkgewogICAgICAgICAgICAgICAgICAgIHJldHVybiBqRGF0YS5kYXRhLnVybAogICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2h0dHA6Ly80My4xNTQuMTA0LjE1MjoxMjM0L2poYXBpL2NzLnBocD91cmw9JyArIHVybC5zcGxpdCgnPScpWzFdCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKC8sLy50ZXN0KGlucHV0KSkgewogICAgICAgICAgICAgICAgbGV0IG1qdXJsID0gaW5wdXQuc3BsaXQoJywnKVsxXQogICAgICAgICAgICAgICAgbGV0IHZpZGVvVXJsID0gZ2V0dmlkZW8obWp1cmwpOwogICAgICAgICAgICAgICAgaW5wdXQgPSB7CiAgICAgICAgICAgICAgICAgICAgang6IDAsCiAgICAgICAgICAgICAgICAgICAgdXJsOiB2aWRlb1VybCwKICAgICAgICAgICAgICAgICAgICBwYXJzZTogMCwKICAgICAgICAgICAgICAgICAgICBoZWFkZXI6IEpTT04uc3RyaW5naWZ5KHsKICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXItYWdlbnQnOiAnTGF2Zi81OC4xMi4xMDAnCiAgICAgICAgICAgICAgICAgICAgfSkKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIGxldCB2aWRlb1VybCA9IGdldHZpZGVvKGlucHV0KTsKICAgICAgICAgICAgICAgIGlmICgvamhhcGkvLnRlc3QodmlkZW9VcmwpKSB7CiAgICAgICAgICAgICAgICAgICAgdmlkZW9VcmwgPSBnZXR2aWRlbyh2aWRlb1VybCk7CiAgICAgICAgICAgICAgICAgICAgaW5wdXQgPSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGp4OiAwLAogICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHZpZGVvVXJsLAogICAgICAgICAgICAgICAgICAgICAgICBwYXJzZTogMCwKICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyOiBKU09OLnN0cmluZ2lmeSh7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAndXNlci1hZ2VudCc6ICdMYXZmLzU4LjEyLjEwMCcKICAgICAgICAgICAgICAgICAgICAgICAgfSkKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgIGlucHV0ID0gewogICAgICAgICAgICAgICAgICAgICAgICBqeDogMCwKICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB2aWRlb1VybCwKICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2U6IDAKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpCiAgICAgICAgfQoJYCwKICAgIOaOqOiNkDogYGpzOgogICAgICAgIHZhciBkID0gW107CiAgICAgICAgbGV0IGh0bWwgPSByZXF1ZXN0KGlucHV0LCB7CiAgICAgICAgICAgIGhlYWRlcnM6IGdldEhlYWRlcnMoaW5wdXQpCiAgICAgICAgfSk7CiAgICAgICAgaHRtbCA9IEpTT04ucGFyc2UoaHRtbCk7CiAgICAgICAgaHRtbC5mb3JFYWNoKGZ1bmN0aW9uKGl0KSB7CiAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICB0aXRsZTogaXQubmFtZSwKICAgICAgICAgICAgICAgIGltZzogaXQuaW1nLAogICAgICAgICAgICAgICAgZGVzYzogaXQucmVtYXJrcywKICAgICAgICAgICAgICAgIHVybDogaXQuaWQKICAgICAgICAgICAgfSkKICAgICAgICB9KTsKICAgICAgICBzZXRSZXN1bHQoZCk7CiAgICBgLAogICAg5LiA57qnOiBganM6CgkJdmFyIGQgPSBbXTsKCQlsZXQgaHRtbCA9IHJlcXVlc3QoaW5wdXQsIHsKCQkJaGVhZGVyczogZ2V0SGVhZGVycyhpbnB1dCkKCQl9KTsKCQlodG1sID0gSlNPTi5wYXJzZShodG1sKTsKCQlodG1sLmxpc3QuZm9yRWFjaChmdW5jdGlvbihpdCkgewoJCQlkLnB1c2goewoJCQkJdGl0bGU6IGl0Lm5hbWUsCgkJCQlpbWc6IGl0LmltZywKCQkJCWRlc2M6IGl0Lm1zZywKCQkJCXVybDogaXQuaWQKCQkJfSkKCQl9KTsKCQlzZXRSZXN1bHQoZCk7CglgLAogICAg5LqM57qnOiBganM6CiAgICAgICAgdmFyIGQgPSBbXTsKICAgICAgICBWT0QgPSB7CiAgICAgICAgICAgIHZvZF9pZDogaW5wdXQuc3BsaXQoJ2lkPScpWzFdCiAgICAgICAgfTsKICAgICAgICB0cnkgewogICAgICAgICAgICBsZXQgaHRtbCA9IHJlcXVlc3QoaW5wdXQsIHsKICAgICAgICAgICAgICAgIGhlYWRlcnM6IGdldEhlYWRlcnMoaW5wdXQpCiAgICAgICAgICAgIH0pOwogICAgICAgICAgICBodG1sID0gSlNPTi5wYXJzZShodG1sKTsKICAgICAgICAgICAgbGV0IG5vZGUgPSBodG1sLmRhdGE7CiAgICAgICAgICAgIFZPRCA9IHsKICAgICAgICAgICAgICAgIHZvZF9uYW1lOiBub2RlWyduYW1lJ10sCiAgICAgICAgICAgICAgICB2b2RfcGljOiBub2RlWydpbWcnXSwKICAgICAgICAgICAgICAgIHR5cGVfbmFtZTogbm9kZVsndHlwZSddLAogICAgICAgICAgICAgICAgdm9kX3llYXI6IG5vZGVbJ3llYXInXSwKICAgICAgICAgICAgICAgIHZvZF9yZW1hcmtzOiAn5pu05paw6IezOiAnICsgbm9kZVsnbXNnJ10gKyAnIC8g6K+E5YiGOiAnICsgbm9kZVsnc2NvcmUnXSwKICAgICAgICAgICAgICAgIHZvZF9jb250ZW50OiBub2RlWydpbmZvJ10uc3RyaXAoKQogICAgICAgICAgICB9OwogICAgICAgICAgICBsZXQgZXBpc29kZXMgPSBub2RlLnBsYXllcl9pbmZvOwogICAgICAgICAgICBsZXQgcGxheU1hcCA9IHt9OwogICAgICAgICAgICBpZiAodHlwZW9mIHBsYXlfdXJsID09PSAndW5kZWZpbmVkJykgewogICAgICAgICAgICAgICAgdmFyIHBsYXlfdXJsID0gJycKICAgICAgICAgICAgfQogICAgICAgICAgICBlcGlzb2Rlcy5mb3JFYWNoKGZ1bmN0aW9uKGVwKSB7CiAgICAgICAgICAgICAgICBsZXQgcGxheXVybHMgPSBlcFsndmlkZW9faW5mbyddOwogICAgICAgICAgICAgICAgcGxheXVybHMuZm9yRWFjaChmdW5jdGlvbihwbGF5dXJsKSB7CiAgICAgICAgICAgICAgICAgICAgbGV0IHNvdXJjZSA9IGVwWydzaG93J107CiAgICAgICAgICAgICAgICAgICAgaWYgKCFwbGF5TWFwLmhhc093blByb3BlcnR5KHNvdXJjZSkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgcGxheU1hcFtzb3VyY2VdID0gW10KICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgcGxheU1hcFtzb3VyY2VdLmFwcGVuZChwbGF5dXJsWyduYW1lJ10uc3RyaXAoKSArICckJyArIHBsYXlfdXJsICsgdXJsZW5jb2RlKHBsYXl1cmxbJ3VybCddKSkKICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgIH0pOwogICAgICAgICAgICBsZXQgcGxheUZyb20gPSBbXTsKICAgICAgICAgICAgbGV0IHBsYXlMaXN0ID0gW107CiAgICAgICAgICAgIE9iamVjdC5rZXlzKHBsYXlNYXApCiAgICAgICAgICAgICAgICAuZm9yRWFjaChmdW5jdGlvbihrZXkpIHsKICAgICAgICAgICAgICAgICAgICBwbGF5RnJvbS5hcHBlbmQoa2V5KTsKICAgICAgICAgICAgICAgICAgICBwbGF5TGlzdC5hcHBlbmQocGxheU1hcFtrZXldLmpvaW4oJyMnKSkKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICBsZXQgdm9kX3BsYXlfZnJvbSA9IHBsYXlGcm9tLmpvaW4oJyQkJCcpOwogICAgICAgICAgICBsZXQgdm9kX3BsYXlfdXJsID0gcGxheUxpc3Quam9pbignJCQkJyk7CiAgICAgICAgICAgIFZPRFsndm9kX3BsYXlfZnJvbSddID0gdm9kX3BsYXlfZnJvbTsKICAgICAgICAgICAgVk9EWyd2b2RfcGxheV91cmwnXSA9IHZvZF9wbGF5X3VybAogICAgICAgIH0gY2F0Y2ggKGUpIHsKICAgICAgICAgICAgbG9nKCfojrflj5bkuoznuqfor6bmg4XpobXlj5HnlJ/plJnor686JyArIGUubWVzc2FnZSkKICAgICAgICB9CglgLAogICAg5pCc57SiOiBganM6CiAgICAgICAgdmFyIGQgPSBbXTsKICAgICAgICBsZXQgaHRtbCA9IHJlcXVlc3QoaW5wdXQsIHsKICAgICAgICAgICAgaGVhZGVyczogZ2V0SGVhZGVycyhpbnB1dCkKICAgICAgICB9KTsKICAgICAgICBodG1sID0gSlNPTi5wYXJzZShodG1sKTsKICAgICAgICBodG1sLmRhdGEuZm9yRWFjaChmdW5jdGlvbihpdCkgewogICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgdGl0bGU6IGl0LnZpZGVvX25hbWUsCiAgICAgICAgICAgICAgICBpbWc6IGl0LmltZywKICAgICAgICAgICAgICAgIGRlc2M6IGl0LnFpbmd4aWR1ICsgJy8nICsgaXQuY2F0ZWdvcnksCiAgICAgICAgICAgICAgICB1cmw6IGl0LmlkLAogICAgICAgICAgICAgICAgY29udGVudDogaXQuYmx1cmIKICAgICAgICAgICAgfSkKICAgICAgICB9KTsKICAgICAgICBzZXRSZXN1bHQoZCk7CiAgICBgLAp9
|